<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewProjectsTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    
                    <h:outputText value="#{bundle.ViewProjectsLabel_projectCode}"/>
                    <h:outputText value="#{projectsController.selected.projectCode}" title="#{bundle.ViewProjectsTitle_projectCode}"/>
                    
                    <h:outputText value="#{bundle.ViewProjectsLabel_projectName}"/>
                    <h:outputText value="#{projectsController.selected.projectName}" title="#{bundle.ViewProjectsTitle_projectName}"/>
                    
                    <h:outputText value="#{bundle.ViewProjectsLabel_activityCode}"/>
                    <h:outputText value="#{projectsController.selected.activityCode}" title="#{bundle.ViewProjectsTitle_activityCode}"/>
                    
                    <h:outputText value="#{bundle.ViewProjectsLabel_createdAt}"/>
                    <h:outputText value="#{projectsController.selected.createdAt}" title="#{bundle.ViewProjectsTitle_createdAt}">
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:outputText>
                    
                    <h:outputText value="#{bundle.ViewProjectsLabel_status}"/>
                    <h:outputText value="#{projectsController.selected.status}" title="#{bundle.ViewProjectsTitle_status}"/>
                    
                    <h:outputText value="#{bundle.ViewProjectsLabel_customer}"/>
                    <h:outputText value="#{projectsController.selected.customer.name}" title="#{bundle.ViewProjectsTitle_customer}"/>
                    
                    <h:outputText value="#{bundle.ViewProjectsLabel_createdBy}"/>
                    <h:outputText value="#{projectsController.selected.createdBy.businessEmail}" title="#{bundle.ViewProjectsTitle_createdBy}"/>
                
                </h:panelGrid>
                <br />
                <h:commandButton action="#{projectsController.destroyAndView}" value="#{bundle.ViewProjectsDestroyLink}" type="submit"/>
                <h:commandButton action="Edit" value="#{bundle.ViewProjectsEditLink}" type="submit"/>
            </h:form>
            <h:form>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <h:commandButton type="submit" action="#{projectsController.prepareCreate}" value="#{bundle.ViewProjectsCreateLink}" />
                <h:commandButton action="#{projectsController.prepareList}" value="#{bundle.ViewProjectsShowAllLink}" type="submit"/>
               <h:button rendered="${type=='admin'}" value="Back to Home" outcome="/index" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
